CC=arm-apple-darwin-cc
CFLAGS=-I/usr/include/libxml2
LD=$(CC)

LDFLAGS=-L/usr/local/arm-apple-darwin/heavenly/usr/lib -Wl,-syslibroot,/usr/local/arm-apple-darwin/heavenly -lobjc -ObjC -framework CoreFoundation -framework Foundation -framework UIKit -framework LayerKit -lxml2 -lz
LDFLAGS_DAEMON=-Wl,-syslibroot,/usr/local/arm-apple-darwin/heavenly -lobjc -ObjC -lxml2 -lz

all:	PXLdaemon pxlinstall

PXLdaemon: PXLdaemon.o unzip.o ioapi.o fileutil.o uzutil.o uiutil.o pkgutil.o
	$(LD) $(LDFLAGS) -o $@ $^

pxlinstall: pxlinstall.o fileutil.o
	$(LD) $(LDFLAGS_DAEMON) -o $@ $^

%.o:	%.m
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

clean:
	rm -f *.o PXL PXLdaemon
